package com.lanchetech.dao;


import com.lanchetech.bean.vo.ShareActivitySpuVo;
import com.lanchetech.bean.vo.ShareActivityVo;
import com.lanchetech.entity.ShareActivitySpu;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Set;

/**
 * @author Ren
 * @description 针对表【share_activity_spu(绑定分享赚商品)】的数据库操作Mapper
 * @createDate 2023-03-15 14:08:30
 * @Entity com.lanchetech.entity.domain.ShareActivitySpu
 */
@Mapper
public interface ShareActivitySpuMapper {

    int deleteByPrimaryKey(Long id);

    int insert(ShareActivitySpu record);

    int insertSelective(ShareActivitySpu record);

    ShareActivitySpu selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(ShareActivitySpu record);

    int updateByPrimaryKey(ShareActivitySpu record);

    List<ShareActivitySpu> getBySkuIds(@Param("activityId") Long activityId,
                                       @Param("skuIds") Set<Long> skuIds);

    void bindSpu(@Param("set") Set<ShareActivitySpu> shareActivitySpus);

    long getByShareActivityId(Long id);

    void removeSpu(@Param("shareActivitySpuId") Long shareActivitySpuId, @Param("deleted") boolean deleted);

    ShareActivitySpuVo getOneShareActivitySpuById(Long shareActivitySpuId);

    List<ShareActivitySpuVo> finAllShareActivitySpuByActivityId(Long shareActivityId);

    List<ShareActivitySpuVo> getSpuByShareActivityId(@Param("shareActivityId") Long id, @Param("deleted") boolean deleted);

    ShareActivitySpu getBySkuIdAndActivityId(@Param("activityId") Long activityId, @Param("skuId") Long skuId);

    List<ShareActivitySpuVo> getShareActivitySpuByIds(@Param("spuIds") List<Long> spuIds);

    List<ShareActivitySpuVo> findAllBySpuId(Long id);

    List<ShareActivitySpuVo> getShareActivitySkuByIds(@Param("skuIds") List<Long> skuIds);

    void updateDeletedByShareActivityId(@Param("shareActivityId") Long shareActivityId, @Param("deleted") boolean deleted);

    void removeSpuBySpuId(@Param("spuId") Long spuId,@Param("deleted") boolean deleted);
}
